package com.chj.comp.service.demo1.service.impl;

import com.chj.comp.service.demo1.service.IXxlJobService;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author ：cuihui
 * @date ：Created in 2022/3/14
 * @description：TODO
 * @modified By：
 */
@Service
@Slf4j
public class XxlJobServiceImpl implements IXxlJobService {
    @Override
    @XxlJob(value = "demoJobHandler")
    public void demoJobHandler() {
        // 获取参数
        String jobParam = XxlJobHelper.getJobParam();
        log.info("logger入参-------------->" + jobParam);
        XxlJobHelper.log("XxlJobHelper入参-------------->" + jobParam);

        // 设置执行结果
        XxlJobHelper.handleSuccess("自定义测试任务执行成功-cuihui");
    }
}
